'use strict'
console.log('global', this)

function fun1( )
{
    console.log('fun1: ', this)
}


fun1();

function fun2( )
{
    console.log('fun2: ', this)
    fun1();
}

fun2();

let a = {};
a.f1 = fun1;
a.f2 = fun2;

// for (let key in a) {
//     if (typeof a[key] == 'function') {
//       a[key] = a[key].bind(a);
//     }
//   }

console.log('-------a-----')
a.f1();
a.f2();
fun1.call(a)
let aBind = fun1.bind(a);
aBind()

console.log('-------timeout-----')
setTimeout(fun1, 0);
setTimeout(fun2, 0);

